package com.xltq.controller;


import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.google.gson.Gson;
import com.xltq.entity.Type;
import com.xltq.service.ITypeService;
import com.xltq.service.impl.ITypeServiceImpl;
import java.util.List;

@WebServlet("/type")
public class TypeController extends BaseServlet {
    public String findAll(HttpServletRequest request,HttpServletResponse response)throws Exception{
        ITypeService typeService = new ITypeServiceImpl();
        List<Type> types = typeService.findAll();
        Gson gson = new Gson();
        String json = gson.toJson(types);
        return json;

    }

}
